package com.traveldream.entity_managers;

import java.util.Date;
import java.util.List;

import javax.ejb.Local;

import com.traveldream.entities.Excursion;
import com.traveldream.entities.Flight;
import com.traveldream.entities.Hotel;
import com.traveldream.entities.Place;

@Local
public interface ProductManager {

	public Excursion create(Excursion excursion);
	public Flight    create(Flight flight);
	public Hotel     create(Hotel hotel);
    
    public Excursion update(Excursion excursion);
    public Flight    update(Flight flight);
    public Hotel     update(Hotel hotel);
    
    public boolean delete(int id);
    
    public Excursion    findExcursion(int id);
    public Flight       findFlight(int id);
    public Hotel        findHotel(int id);
    
    public List<Excursion> findAllExcursions();
    public List<Hotel> findAllHotels();
    public List<Flight> findAllFlights();
    
    // se end(start)=null si cerca solo per data di inizio(fine)
 	// cerca flight con f.depDate >= di start e f.arrDate <= end
 	public List<Flight> findFlightByDates(Date start,Date end);
 	// cerca hotel con h.check_inDate >= di start e h.check_outDate <= end
 	public List<Hotel> findHotelByDates(Date start,Date end);
 	// cerca excursion con e.date >= di start ed e.date <= end
  	public List<Excursion> findExcursionByDates(Date start,Date end);
  	
  	// cerca volo per attributo place relativo al prodotto (place di arrivo)
  	public List<Flight> findFlightByArrivalPlace(Place arrivalPlace);
  	// cerca volo per place di partenza
  	public List<Flight> findFlightByDeparturePlace(Place departurePlace);
  	public List<Hotel> findHotelByPlace(Place p);
  	public List<Excursion> findExcursionByPlace(Place p);
  	
  	
  	public List<Flight> findFlightByDatesAndPlace(Date start,Date end,Place arrivalPlace);
 	public List<Hotel> findHotelByDatesAndPlace(Date start,Date end,Place p);
  	public List<Excursion> findExcursionByDatesAndPlace(Date start,Date end,Place p);
  	
  	

}
